package net.hn.hnms.biz.meeting.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.meeting.request.MeetingPersonReq;
import net.hn.hnms.biz.meeting.service.MeetingPersonService;
import net.hn.hnms.biz.meeting.vo.MeetingPersonVo;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.core.web.controller.BaseController;
import net.hn.hnms.sys.common.log.annotation.Log;
import net.hn.hnms.sys.common.log.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(value = "会议室预约", tags = {"会议室预约"})
@RestController
@RequestMapping("/meeting/person/management")
public class MeetingPersonController  extends BaseController {


    @Autowired
    private MeetingPersonService meetingPersonService;



    @GetMapping("/list")
    public R<List<MeetingPersonVo>> list(MeetingPersonReq meetingPersonReq) {
        return R.ok(meetingPersonService.selectListSq(meetingPersonReq));
    }


    @ApiOperation("修改会议签到人员")
    @SaCheckPermission("person:management:update")
    @PostMapping("update")
    @Log(title = "修改会议签到人员", businessType = BusinessType.UPDATE)
    public R<Void> update(@RequestBody List<MeetingPersonReq> List) {
        meetingPersonService.updateBatchMeetingPerson(List);
        return R.ok();
    }


}
